package com.infore.dataReceiving.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.infore.dataReceiving.dto.ManualDataDto;
import com.infore.dataReceiving.service.IManualDataService;
import com.infore.dataReceiving.util.ResultEntity;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Controller
public class ManualDataController {
    
    @Autowired
    IManualDataService IManualDataService;
    
    @ApiOperation(value = "保存手工监测数据", notes = "保存手工监测数据")
    @RequestMapping(value = "/saveManualData", method = RequestMethod.POST)
    @ResponseBody
    public ResultEntity saveManualData(@RequestBody ManualDataDto manualDataDto) {
        return IManualDataService.saveManualData(manualDataDto);
    }
    
    @ApiOperation(value = "查询手工监测数据", notes = "查询手工监测数据")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "stationCode", value = "站点编码", paramType = "query", required = true, dataType = "String"),
        @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", required = true, dataType = "String"),
        @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", required = true, dataType = "String")})
    @RequestMapping(value = "/queryManualData", method = RequestMethod.GET)
    @ResponseBody
    public ResultEntity queryManualData(String stationCode, String startTime, String endTime) {
        return IManualDataService.queryManualData(stationCode, startTime, endTime);
    }
    
    @ApiOperation(value = "手工数据与实时数据比对", notes = "手工数据与实时数据比对")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "stationCode", value = "站点编码", paramType = "query", required = true, dataType = "String"),
        @ApiImplicitParam(name = "time", value = "开始时间", paramType = "query", required = true, dataType = "String")})
    @RequestMapping(value = "/comparisonData", method = RequestMethod.GET)
    @ResponseBody
    public ResultEntity comparisonData(String stationCode, String time) {
        return IManualDataService.comparisonData(stationCode, time);
    }
}
